/**
 * @author Flower
 * @description api url setting
 */
//const HostName = 'https://apitest.quantumhealth.cn/customer';
let HostName = 'https://apitest.quantumhealth.cn/customer';
// if( window.location.href.indexOf('m.quantumhealth.cn')>=0 ){
//     HostName = 'https://api.quantumhealth.cn/customer';
// }else{
//     HostName = 'https://apitest.quantumhealth.cn/customer';
// }
const serverHost = '/';

const lottoryHost = 'https://luckyapi.quantumhealth.cn'

const ApiUrl = {
    /**auth api**/
    login: {url: HostName + '/jwtauth/wechat-login', method: 'POST' , noAuth: true},
    loginAlipay: {url: HostName + '/jwtauth/alipay-login', method: 'POST',noAuth: true},
    getCaptchaCode: { url: HostName + '/bind-verifycode/sms/_send', method: 'GET' , noAuth: true},
    refreshToken: { url: HostName+ '/jwtauth/refresh', method: 'POST' },
    createUser: { url: HostName+'/user', method: 'POST' , noAuth: true },
    setPassword: { url: HostName+ '/user/_set-password', method: 'PUT'},
    getWechatInfo: { url: serverHost + 'getAuthInfo', method: 'POST' },
    getShareInfo:{ url: serverHost + 'getShareInfo', method: 'GET' },
    logOut:{url:HostName + '/user/_unbind',method:'PUT'},
    /**auth api End**/

    /**mall api**/
    getProductList: { url: HostName + '/repos/bodyindex_panel_group/items', method: 'GET', noAuth: true },
    getProductDetail: { url: HostName + '/repos/bodyindex_panel_group/items/:id', method: 'GET', noAuth: true},
    getGoodsItems: { url: HostName + '/repos/good/items', method: 'GET', noAuth: true},
    getGoodsCategory: { url: HostName + '/repos/good-category/items', method: 'GET', noAuth: true },
    getGoodsDetail: { url: HostName + '/repos/good/items/:id', method: 'GET' , noAuth: true},
    getSubjectItems: { url: HostName + '/repos/subject/items', method: 'GET', noAuth: true},
    getSubjectItem: { url: HostName + '/repos/subject/items/:id', method: 'GET', noAuth: true },

    getCart: { url: HostName + '/cart', method: 'GET' },
    addCart:{ url: HostName + '/cart/_add', method: 'PUT' },
    deleteCart:{ url: HostName + '/cart/_remove', method: 'PUT'},
    /**mall api End**/

    /** checkout */
    getMembers: { url: HostName + '/members', method: 'GET',name: 'members'},
    // saveOrder: { url: HostName + '/members/:member_id/services/labtest/orders', method: 'POST'},
    makePreOrder: { url: HostName + '/checkouts', method: 'POST' },
    getPreOrder: { url: HostName + '/checkouts/:id', method: 'GET' },
    setCheckoutMember: { url: HostName + '/checkouts/:id/_set-member', method: 'PUT' },
    setCheckoutItems: { url: HostName + '/checkouts/:id/_set-goods', method: 'PUT' },
    setCheckoutNotes: { url: HostName + '/checkouts/:id/_set-note', method: 'PUT' },
    setCheckoutAddress: { url: HostName + '/checkouts/:id/_set-address', method: 'PUT' },
    saveOrder: { url: HostName + '/checkouts/:id/_place-order', method: 'PUT' },
    getCashierInfo: { url: HostName + '/cashier/payorders', method: 'GET' },
    postCashier: { url: HostName + '/cashier/charges', method: 'POST' },
    /** checkout End*/

    /** address */
    getAddressList: { url: HostName + '/addresses', method: 'GET' }, 
    addAddress: { url: HostName + '/addresses', method: 'POST' },
    getAddressById: { url: HostName + '/addresses/:id', method: 'GET' },
    editAddress: { url: HostName + '/addresses/:id', method: 'PUT' },
    deleteAddress: { url: HostName + '/addresses/:id', method: 'DELETE' },
    setAddressAsDefault: { url: HostName + '/addresses/:id/_set-default', method: 'PUT' },
    /** address End */

    // /**user api */
    terminalInfo: {url: HostName + '/terminals/_search', method: 'GET'},
    bindTerminal: {url: HostName + '/terminals/_bind', method: 'PUT'},
    unbind: {url: HostName + '/terminals/_unbind', method: 'PUT'},
    changeTerminal: {url: HostName + '/terminals/_change', method: 'PUT'},
    uploadAvatar: {url: HostName + '/members/:member_id/avatar', method: 'POST'},
    getMember: {url: HostName + '/members/:member_id', method: 'GET'},
    addMember: {url: HostName + '/members', method: 'POST'},
    editMember: {url: HostName + '/members/:member_id', method: 'PUT'},
    deleteMember: {url: HostName + '/members/:member_id', method: 'DELETE'},
    getMembersNum: { url: HostName + '/members/_count', method: 'GET'},

    user: {url: HostName + '/user', method: 'GET', name: 'profile'},
    members: {url: HostName + '/members', method: 'GET', name: 'members'},
    panelReportList: {url: HostName + '/members/:member_id/services/labtest/reports', method: 'GET'},
    getGoodsReport: {url: HostName + '/members/:member_id/services/labtest/reports/:report_id', method: 'GET'},
    reportDownload:{ url : HostName + '/members/:member_id/services/labtest/reports/:report_id/_download', method: 'GET'},
    goodReportList: {url: HostName + '/members/:member_id/services/labtest/reports', method: 'GET'},
    getShareReport: {url: HostName + '/services/labtest/reports/:report_id/_forward', method: 'GET',noAuth: true},
    /**user api End*/

    /** order api */
    orderListData: { url: HostName + '/members/:member_id/services/labtest/orders', method: 'GET'},
    getOrderDetail: { url: HostName + '/members/:member_id/services/labtest/orders/:id', method: 'GET' },
    cancelOrder: { url: HostName + '/members/:member_id/services/labtest/orders/:id', method: 'DELETE'},
    /** order End */

    // refund api
    applyRefund:{url: HostName + '/members/:member_id/services/labtest/orders/:order_id/goods/:good_id/_apply-refund',method:'PUT'},
    cancelRefund:{url: HostName + '/members/:member_id/services/labtest/orders/:order_id/goods/:good_id/_cancel-refund',method:'PUT'},
    reApplyRefund:{url: HostName + '/members/:member_id/services/labtest/orders/:order_id/goods/:good_id/_reapply-refund',method:'PUT'},
    refund:{url: HostName + '/members/:member_id/services/labtest/orders/:order_id/goods/:good_id/refund',method:'GET'},

    // refund api end
    // sampleBox api
    sampleBoxList:{url:HostName + '/repos/good/items', method: 'GET'}
    // sampleBox api end
}

export default ApiUrl;